package com.mnsq.common.bean.entity.friends;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.mnsq.common.bean.entity.CommonEntity;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * @author 周俭
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "friends", indexes = {@Index(name = "self_target", columnList = "self_id,target_user_id", unique = true)})
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Friends extends CommonEntity {
    private static final long serialVersionUID = -7626414777406448391L;
    @Column(name = "self_id", columnDefinition = "bigint(19) not null comment '自身id'")
    private Long selfId;
    @Column(name = "target_user_id", columnDefinition = "bigint(19) not null comment '目标用户id'")
    private Long targetUserId;
    @Column(name = "comment_name", columnDefinition = "varchar(30) default null comment '备注名称'")
    private String commentName;
    @Column(name = "group_name", columnDefinition = "varchar(30) default null comment '分组名称'")
    private String groupName;
    /**
     * @see com.mnsq.common.bean.enums.ApplyType
     */
    @Column(name = "apply", columnDefinition = "int(2) not null comment '申请状态'")
    private Integer apply;
}
